import { AxiosResponse } from "axios";
import { App } from "vue";
import request from "./axios.config";
import Vue from 'vue'
import http from "./http";

export default {
  getInitKey() {
    return http.get({ url: "/sign/login/get" });
  },
  getNumber(data) {
    return http.get({ url: "/sign/captcha", data: data })
  },
  login_signin(data) {
    return http.post({ url: "/sign/login/signin", data: data })
  },
  session_fetch(data) {//初始化会话
    return http.get({ url: "/sign/access/session/fetch", data: data })
  },
  loginHistory_fetch(data) {//系统登录日志
    return http.get({ url: "/sign/access/session/fetch", data: data });
    // return request("/sign/historys/loginHistory/fetch", "get", data,)
  },
  thirdLogin(oneParam, rememberMe) {
    return http.get({ url: "/sign/login/get?_allow_anonymous=+" + oneParam + "&remember_me=" + rememberMe })
  },
  goThirdLogin(provider) {
    return http.get({ url: "/sign/logon/oauth20/authorize/" + provider })
  },
  terminate(data) {
    return http.get({ url: "/sign/access/session/terminate", data: data })
  },
  oauthv20(data) {
    return http.get({ url: "/sign/authz/oauth/v20/approval_confirm/get/" + data })
  },
  getMenuTree() {
    return http.get({ url: "/sign/mxkMenu/getMenuTree" })
  },
  approval(data) {
    return http.post({ url: "/sign/authz/oauth/v20/authorize/approval?user_oauth_approval=" + data.user_oauth_approval + "&client_id=" + data.clientId, data: data })
  },
  getMessaageCode(data) {
    return http.post({ url: "/sign/forgotpassword/produceOtp?mobile=" + data.mobile + "&state=" + data.state + "&captcha=" + data.captcha })
  },
  //修改密码
  //sign/forgotpassword/setpassword
  updatePassword(data) {
    // sign/forgotpassword/produceOtp
    return http.post({ url: "/sign/forgotpassword/setpassword?forgotType=mobile&userId=" + data.userId + "&username=" + data.username + "&state=" + data.state + "&password=" + data.password + "&confirmPassword=" + data.confirmPassword + "&otpCaptcha=" + data.otpCaptcha })
  },
  getUserInfo() {
    return http.get({ url: "/sign/config/profile/get" })
  },
  getAppList() {
    return http.get({ url: "/sign/appList" })
  },
  saveSchedule(data) {
    return http.post({ url: "/sign/jwCalendar/addCalendar", data: data })
  },
  getWeekTimeAsk(data) {
    return http.get({ url: "/sign/jwCalendar/queryByAll?excursion=" + data })
  },

  queryByDate(data) {
    return http.get({ url: "/sign/jwCalendar/queryByDate", data: data })
  },
  deleteById(data) {
    return http.post({ url: "/sign/jwCalendar/deleteById?id=" + data })
  },
  editCalendar(data) {
    return http.post({ url: "/sign/jwCalendar/editCalendar", data: data })
  },
  authenticationUser(data) {
    return http.post({ url: "/sign/home/authenticationUser", data: data })
  },
  authenticationPhone(data) {
    return http.post({ url: "/sign/home/authenticationPhone", data: data })
  },
  getisAlter() {
    return http.post({ url: "/sign/home/isAlter"})
  },
};

